package com.karst.essentials.chapter03
{
	import flash.events.Event;
	
	import org.papervision3d.objects.primitives.Plane;
	import org.papervision3d.view.BasicView;
	
	internal class PlanExample extends BasicView
	{
		public function PlanExample()
		{
			super() ;
			createView() ;
			startRendering() ;
		}

		private var plane : Plane = null ;
		private function createView() : void
		{
			if( plane == null )
				plane = new Plane( null, 300, 300, 2, 2 ) ;
			scene.addChild( plane ) ;
			plane.x = 200 ;
			plane.y = 200 ;
			plane.z = 300 ;
			plane.localRotationZ = 45 ;
			plane.material.doubleSided = true ;
		}
		
		override protected function onRenderTick(event:Event=null):void
		{
			super.onRenderTick() ;
			if( plane )
				plane.localRotationY++ ;
		}
	}
}